import requests
riqi = '2022/09/30'
#input('输入格式如下:xxxx-')
cookies = {
   'st_sp': f'{riqi}%2014%3A57%3A10',
}
headers = {
    'User-Agent':'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) /63.0.3239.132 Safari/537.36 QIHU 360SE'
}
b=0
s=0
for page in range(27):
   params = (
       ('pagesize', '144'),
       ('ut', '7eea3edcaed734bea9cbfc24409ed989'),
       ('dpt', 'wzfscj'),
       ('cb', 'jQuery1124029337350072397084_1631343037828'),
       ('pageindex', str(page)),
       #('id', '6009051'),
       ('sort', '1'),
       ('ft', '1'),
       ('code', '601390'),
       ('market', '1'),
       ('_', '1631343037827'),
   )
   response = requests.get('http://push2ex.eastmoney.com/getStockFenShi', headers=headers, cookies=cookies,params=params,  verify=True)


   for data in eval(response.text[43:-2])['data']['data']:
       print(data)
       if data['bs']== 1:
           b=b+1
       else:
           s=s+1

print('投票机',b,' ',s)


